package com.mapforge.gui.frames;

import java.awt.BorderLayout;

import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JScrollPane;

import com.mapforge.Constants;

public final class AboutApplicationDialog extends JDialog {
	/**
	 * Default serial version ID, here to remove warnings.
	 */
	private static final long serialVersionUID = 1L;
	private JScrollPane scrlAbout;
	private JLabel lblAbout;
	private String aboutText = "<html><b><i>" + Constants.APP_TITLE
			+ "</i></b>, version " + Constants.APP_VERSION
			+ "<p><p>Author: Will Morrison<p>With thanks to:</html>";

	public AboutApplicationDialog(JFrame parent) {
		super(parent, "About " + Constants.APP_TITLE, true);
		this.initGUI();
		this.layoutGUI();
		this.setResizable(false);
	}

	private final void initGUI() {
		lblAbout = new JLabel(aboutText, JLabel.CENTER);
		scrlAbout = new JScrollPane(lblAbout);
	}

	private final void layoutGUI() {
		super.add(scrlAbout, BorderLayout.CENTER);
		pack();
		this.setLocationRelativeTo(getParent());
	}

	/*
	 * @Override public Component add(Component c) { return null; }
	 * 
	 * @Override public void add(Component c, Object constraints) {
	 * 
	 * }
	 */
}
